#include"Common.h"

//单例模式
class CentralCache
{
public:
    static CentralCache* GetInstance()
    {
        return &_sInst;
    }

    //从中心缓存获取一定的对象数量给thread cache
    size_t FetchRangobj(void*& start,void*& end,size_t n,size_t size);

    //获取一个非空的span
    Span* GetOneSpan(SpanList& list,size_t size);

    //将一定数量的对象释放到span跨度
    void ReleaseListToSpans(void* start,size_t byte_size);
private:
    //私有构造和拷贝构造
    CentralCache(){}

    CentralCache(const CentralCache&) = delete;

private:
    SpanList _spanlists[NFREELIST];
    static CentralCache _sInst;
};